package net.wanho.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.enums.BooleanEnum;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.wanho.convert.GenderConverter;
import org.apache.poi.ss.usermodel.Font;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * Author：汤小洋
 * Date：2023-08-29 11:19
 * Description：<描述>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ColumnWidth(20)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
@HeadFontStyle(bold = BooleanEnum.TRUE, color = Font.COLOR_RED)
public class Student implements Serializable {
    @ExcelProperty(value = "学号",index = 0)
    @ColumnWidth(10)
    private Integer id;

    @ExcelProperty(value = "学生姓名",index = 1)
    private String name;

    @ExcelProperty(value = "学生年龄",index = 2)
    private Integer age;

    @ExcelProperty(value = "学生性别",index = 3, converter = GenderConverter.class)
    private Integer gender;

    @ExcelProperty(value = "学生地址",index = 4)
    private String address;

    @ExcelProperty(value = "学生生日",index = 5)
    @ColumnWidth(30)
    @DateTimeFormat("yyyy-MM-dd")
    private LocalDateTime birthday;

}
